import {Component, signal} from '@angular/core';
import {LostOrFindService} from "../../services";
import {NzNotificationService} from "ng-zorro-antd/notification";

@Component({
  selector: 'app-lost',
  templateUrl: './lost.component.html',
  styleUrl: './lost.component.css'
})
export class LostComponent {
  occasions: any[] | undefined;
  reload(){
    this.lostOrFindService.getSome(1, 100, true)
      .subscribe(
        {
          next: (occasions)=>{
            this.occasions = occasions;
            this.notification.success("加载成功","")
          },
          error: (error)=>{
            this.notification.error("加载失败","")
          }
        }
      )


  }
  constructor(private lostOrFindService: LostOrFindService,
              private notification: NzNotificationService) {
    this.reload();
  }
}
